package cn.poco.pepsi.adapter;

import java.util.List;

import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import cn.poco.pepsi.R;
import cn.poco.pepsi.bean.Dish;
import cn.poco.pepsi.bean.HotSearchKey;

/**
 * 鎼滅储涓婚〉闈㈡洿澶氳彍寮忛�傞厤鍣�
 * @author tanglx
 *
 */
public class SearchMainMoreHotKeyAapt extends BaseAdapter {
	private Context context;
	private List<HotSearchKey> list;
	
	public SearchMainMoreHotKeyAapt(Context context,List<HotSearchKey> list){
		this.context=context;
		this.list=list;
	}
	
	@Override
	public int getCount() {
		return list.size();
	}

	@Override
	public Object getItem(int position) {
		return list.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		CustomView customView;
		if (convertView==null) {
			customView=new CustomView();
			convertView=LayoutInflater.from(context).inflate(R.layout.search_main_item, null);
			customView.textView=(TextView)convertView.findViewById(R.id.search_main_item_textview);
			convertView.setTag(customView);
		}else {
			customView=(CustomView)convertView.getTag();
		}
		customView.textView.setText(list.get(position).getKeyword());
		customView.textView.setTextColor(Color.WHITE);
		return convertView;
	}
	
	class CustomView{
		TextView textView;
	}

}
